<div class="vista_toolbar">
	<ul>
		<%= toolbar_add 'yhteyshenkilö', 'contacts', customer %>
		<%= toolbar_delete_selected 'contacts' %>
	</ul>
</div>
<%form_remote_tag :url => destroy_selected_contacts_url(:customer_id => customer), :confirm => 'Haluatko varmasti poistaa yhteyshenkilöt?', :before => "spinnerOn('contacts');", :complete => "spinnerOff('contacts');" , :method => :delete, :html => {:id => 'contacts_form'} do %><%if customer.contacts.empty? %>
<div class="container">
    Yhteyshenkilö puuttuu.
</div>
<%else %>
<div class="scrollable" style="height:15em">
    <%customer.contacts.each do |contact| %>
    <div class="container">
        <div style="float:right">
        	
            <%=icon_edit 'contacts', contact, customer %>
			<%=checkbox_delete_selected 'contacts', contact.id %>
        </div>
        <%=content_tag :div, contact.first_name + ' ' + contact.last_name, :class => 'name', :onclick => visual_effect(:toggle_blind, "contact_details_" + contact.id.to_s, :duration => 1.0) %><%=content_tag :div, contact.role, :class => 'role' %>
        <br/>
        <div style="display:none" id="contact_details_<%=contact.id%>">
            <%=content_tag :div, 'Puhelin:', :class => 'item_title' %><%=h contact.phone %>
            <br/>
            <%=content_tag :div, 'Matkapuhelin:', :class => 'item_title' %><%=h contact.mobile %>
            <br/>
            <%=content_tag :div, 'Faksi:', :class => 'item_title' %><%=h contact.fax %>
            <br/>
            <%=content_tag :div, 'Sähköposti:', :class => 'item_title' %><%= mail_to contact.email, contact.email %>
        </div>
        <div style="clear:both">
        </div>
    </div>
    <%end %>
</div>
<%end %>
<%end %>